using System.Collections.Generic;

namespace PKGames.Analytics
{
	public abstract class AnalyticsEvent
	{
		protected abstract int Flags
		{
			get;
		}

		protected abstract string Name
		{
			get;
		}

		protected abstract int Revision
		{
			get;
		}

		protected Dictionary<string, UnityEncodedPrimitiveData> Parameters
		{
			get;
			set;
		}

		protected AnalyticsEvent()
		{
			Parameters = new Dictionary<string, UnityEncodedPrimitiveData>();
		}

		public abstract void Finish();

		public void Log()
		{
			if (MonoSingleton<AnalyticsManager>.Instance != null)
			{
				MonoSingleton<AnalyticsManager>.Instance.LogEvent(Name, Parameters, Flags, Revision);
			}
		}
	}
}
